import request from "./request";

export const getTodos = () => {
  return request({
    method: "get",
    url: "/todos",
  });
};

export const addTodos = (data) => {
  return request({
    method: "post",
    url: "/todos",
    data,
  });
};

export const editTodos = (id, completed) => {
  return request({
    method: "patch",
    url: "/todos/" + id,
    data: {
      completed,
    },
  });
};

export const deleteTodos = (id) => {
  return request({
    method: "delete",
    url: "/todos/" + id,
  });
};
